package org.com.behavioralPattern.commandPattern;

import javax.swing.*;
import java.awt.*;

/**
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/15 18:05
 */
public class RedCommand extends JButton implements MyCommand {
    private JPanel p;

    public RedCommand(String name,JPanel p){
        super(name);
        this.p=p;
    }

    @Override
    public void execute() {
        p.setBackground(Color.red);
    }
}
